import { get, getDownload, getPages, post, springBootPost, uploadFile } from '@/utils/request';

export const uploadCourse = (file: File) => uploadFile('/course/upload', file);

export const getCourse = () => getPages('/course');

export const getLeader = () => getPages('/leader');

export const getCrew = () => getPages('/crew');

export const crewSubmitPhoto = () => post(`/crew/uploadPhoto`);

export const allCrewServices = () => get('/leader/getCrewAll');

export const courseAllocation = (data: { crewId: string; courseId: string }) =>
  post('/crew/allocationCourse', data);

export const crewSuperServices = () => get('/crew/getCrewSuper');

export const pushSupersitionServices = (data: any) => post('/crew/pushSupersition', data);

/**
 * 获取督导的记录
 */
// export const getSupervisionRecord = () => get('/supersition/list')
export const getSupervisionRecord = (data: any) => springBootPost('/supersition/pagingQuery', data);

// 获取组长列表
export const getLeaderList = () => get('/leader/list');

// 提交组长的督导时间
export const submitPeriod = (data: { leaderId: number; period: string }) =>
  post('/leader/updatePeriod', data);

//
export const exportsCameraDataServices = () => getDownload('/supersition/exportFile/crewCamera');

export const pushDingDingServices = (data: any) => post('/crew/dingding', data);

// 清除组员课程关系表
export const clearCourseCrewServices = () => get('/leader/clearCourseCrew');

// 通过课程id获取包括行为信息的督导记录
export const detailInfoService = (courseId: { courseId: number }) =>
  post('/supersition/detail', courseId);

// 教师导出数据为excel的请求
export const exportExcelServices = (data: { week: string }) =>
  post('/supersition/exportFile/excel', data);
